package com.food.mapper;

import com.food.model.MealRecord;
import com.food.model.MealRecordDetail;
import com.food.model.dashboard.DailyNutrition;
import com.food.model.dashboard.DashboardMealRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;

@Mapper
public interface MealRecordMapper {
    void insert(MealRecord record);
    void insertDetail(MealRecordDetail detail);
    List<MealRecord> findByUserIdAndDate(@Param("userId") Integer userId, @Param("date") LocalDate date);
    MealRecord findByIdAndUserId(@Param("recordId") Integer recordId, @Param("userId") Integer userId);
    void deleteDetails(Integer recordId);
    void deleteById(@Param("recordId") Integer recordId, @Param("userId") Integer userId);
    DailyNutrition getDailyNutrition(@Param("userId") Integer userId, @Param("date") LocalDate date);
    List<DashboardMealRecord> getRecentMeals(@Param("userId") Integer userId, @Param("date") LocalDate date);
} 